package com.acegear.horizon.domain.repository.jpa;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.acegear.horizon.domain.models.jpa.ClubLabel;

public interface ClubLabelRepository extends PagingAndSortingRepository<ClubLabel, Long> {

	List<ClubLabel> findClubLabelListByClubId(Long clubId);
	
//	@Query("select id,name from ClubLabel where name like %:name%")
//	List<ClubLabel> findClubLabelListByName(@Param("name") String name);

	@Query("select cl from ClubLabel cl where cl.id in :ids")
	List<ClubLabel> findByIds(@Param("ids") List<Long> ids);
	
	@Modifying
    @Transactional
    void deleteByClubIdAndName(Long clubId, String name);
}
